﻿using System.Net;

namespace Toybox.NicoSharp.Live
{
	using Abstracts;

	/// <summary>
	/// Live クラス
	/// </summary>
	public class Live : AbstractXmlContent
	{

		#region Constructor

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="contentId"></param>
		/// <param name="cookies"></param>
		public Live(ContentId contentId, CookieCollection cookies = null)
			: base(contentId, cookies)
		{
		}

		/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="contentId"></param>
		/// <param name="cookies"></param>
		public Live(string contentId, CookieCollection cookies = null)
			: base(contentId, cookies)
		{
		}

		#endregion Constructor


		#region Public Methods

		/// <summary>
		/// PlayerStatus 取得
		/// </summary>
		/// <returns></returns>
		public PlayerStatus GetPlayerStatus()
		{
			return PlayerStatus.Get(this.ContentId.CompleteId, this.Cookies);
		}

		/// <summary>
		/// PublishStatus 取得
		/// </summary>
		/// <returns></returns>
		public PublishStatus GetPublishStatus()
		{
			return PublishStatus.Get(this.ContentId.CompleteId, this.Cookies);
		}

		/// <summary>
		/// StreamInfo 取得
		/// </summary>
		/// <returns></returns>
		public StreamInfo GetStreamInfo()
		{
			return StreamInfo.Get(this.ContentId.CompleteId);
		}


		/// <summary>
		/// 放送からの離脱
		/// </summary>
		/// <returns></returns>
		public bool Leave()
		{
			return LiveUtility.Leave(this.ContentId.CompleteId, this.Cookies);
		}

		#endregion Public Methods

	}
}
